package a.f.n;

import a.a.kb;
import a.c.a;
import a.c.ab;
import a.c.bb;
import a.c.m;
import a.c.n;
import a.c.q;
import a.c.v;
import a.c.z;
import a.d.f;
import a.d.t;
import a.f.c.h;
import a.f.cb;
import a.f.*;
import a.i.db;
import a.i.p;
import a.i.y;

import java.awt.geom.Rectangle2D;
import java.util.*;

import a.f.n.r;
import a.i.y;
import a.f.n.x;
import a.i.p;
import a.f.n.w;
import a.f.n.u;

public class d
  extends mb
{
  public static final Object w = "y.layout.tree.GenericTreeLayouter.NODE_PLACER_DPKEY";
  public static final Object x = "y.layout.tree.GenericTreeLayouter.PORT_ASSIGNMENT_DPKEY";
  public static final Object y = "y.layout.tree.GenericTreeLayouter.CHILD_COMPARATOR_DPKEY";
  static final Object z = "y.layout.tree.GenericTreeLayouter.EDGE_REVERSED_DPKEY";
  private a.c.x A;
  private a.c.x B;
  private double C = 2.0D;
  private a.c.k D = new p()
  {
    public Object get(Object paramAnonymousObject)
    {
      a.c.e locale = (a.c.e)paramAnonymousObject;
      return d.this.i(locale);
    }
  };
  private a.c.k E = new p()
  {
    public Object get(Object paramAnonymousObject)
    {
      return d.this.d((a.c.e)paramAnonymousObject);
    }
  };
  private a.i.sb F;
  private a.i.sb G;
  private a.i.sb H;
  private a.i.sb I;
  private a.i.sb J;
  protected a.f.o K;
  private gb L = new j();
  private gb M = new eb();
  private hb N = new x();
  private Comparator O = null;
  private boolean P;
  private boolean Q;
  private boolean R = true;
  private a.c.x S;
  private a.c.x T;
  private h U;
  private n V;
  private final yb W;
  public static int X;
  
  public d()
  {
    if (!k.n) {}
    d(!s());
    cb localcb = new cb();
    localcb.a(false);
    j(localcb);
    this.W = new yb();
  }
  
  yb a()
  {
    return this.W;
  }
  
  public boolean s()
  {
    return this.R;
  }
  
  public void h(boolean paramBoolean)
  {
    this.R = paramBoolean;
    if (!k.n) {}
    d(!paramBoolean);
  }
  
  protected boolean b(a.f.o paramo)
  {
    return a(paramo, s());
  }
  
  static boolean a(a.f.o paramo, boolean paramBoolean)
  {
    boolean bool3 = k.n;
    boolean bool2 = k.m;
    if (paramo == null) {
      return false;
    }
    y localy = null;
    if ((bool3) || ((paramBoolean) && (h.b(paramo))))
    {
      localy = new y(paramo);
      a.c.k localk1 = paramo.c(a.f.c.i.b);
      HashSet localHashSet = new HashSet();
      Object localObject = paramo.v();
      do
      {
        if (!((a.c.w)localObject).e()) {
          break;
        }
        localHashSet.add(localk1.get(((a.c.w)localObject).d()));
        ((a.c.w)localObject).f();
        if ((!bool3) && (bool2)) {
          break label222;
        }
      } while (!bool2);
      localObject = paramo.c(a.f.c.i.a);
      a.c.k localk2 = paramo.c(a.f.c.i.c);
      if (bool3) {
        break label223;
      }
      a.c.w localw = paramo.v();
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (bool2) {
          break label226;
        }
        if (localk2.getBool(locale))
        {
          if (bool3) {
            continue;
          }
          if (localHashSet.contains(((a.c.k)localObject).get(locale))) {
            localy.a(locale);
          }
        }
        localw.f();
      } while (!bool2);
    }
    label222:
    label223:
    label226:
    boolean bool1 = kb.e(paramo);
    if ((bool3) || (localy != null)) {
      localy.g();
    }
    return bool1;
  }
  
  private bb a(h paramh)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    bb localbb1 = new bb();
    bb localbb2 = paramh.c(paramh.d());
    do
    {
      do
      {
        a.c.e locale;
        do
        {
          if (localbb2.isEmpty()) {
            break;
          }
          locale = localbb2.o();
        } while (!paramh.f(locale));
        localbb1.add(locale);
        if (bool2) {
          break label97;
        }
        localbb2.addAll(paramh.c(locale));
        if ((bool2) || (bool1)) {
          return localbb1;
        }
      } while (bool2);
    } while (!bool1);
    localbb1.j();
    label97:
    return localbb1;
  }
  
  protected void a(a.f.o paramo)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (!bool2) {
      if (!b(paramo)) {
        throw new a("Graph is not a tree");
      }
    }
    if ((bool2) || (h.b(paramo))) {
      if (bool2) {}
    }
    int i = this.R ? 1 : 0;
    this.U = null;
    bb localbb1 = null;
    y localy = null;
    if (!bool2)
    {
      if (i != 0) {
        this.U = new h(paramo);
      }
    }
    else
    {
      localbb1 = a(this.U);
      localy = new y(paramo);
      localy.a(localbb1);
    }
    if (((bool2) || (i != 0)) && ((bool2) || ((paramo.n()) && (!localbb1.isEmpty()))))
    {
      localy.g();
      this.U.e();
      this.U = null;
      return;
    }
    this.K = paramo;
    this.A = paramo.B();
    this.B = paramo.B();
    try
    {
      this.F = a.i.sb.b(paramo, w);
      this.G = a.i.sb.b(paramo, x);
      this.H = a.i.sb.b(paramo, y);
      this.I = a.i.sb.a(paramo, ed.a);
      this.J = a.i.sb.a(paramo, ed.b);
      ab localab = t();
      a(localab);
      this.V = paramo.C();
      paramo.a(z, this.V);
      Object localObject1 = localab.l();
      Object localObject2;
      do
      {
        if (!((m)localObject1).e()) {
          break;
        }
        localObject2 = ((m)localObject1).a();
        this.V.a(localObject2, Boolean.TRUE);
        ((m)localObject1).f();
      } while (!bool1);
      try
      {
        localObject1 = kb.h(paramo);
        if (i != 0)
        {
          localObject2 = a(paramo, (a.c.e)localObject1);
          this.S = paramo.B();
          this.T = paramo.B();
          a.c.w localw = localbb1.l();
          label515:
          do
          {
            if (!localw.e()) {
              break;
            }
            a.c.e locale1 = localw.d();
            bb localbb2 = a(locale1, this.U);
            if (bool1) {
              break label534;
            }
            if (!bool2)
            {
              if (!localbb2.isEmpty())
              {
                a.c.e locale2 = a((a.c.e)localObject1, localbb2, (a.c.x)localObject2);
                this.T.a(locale1, locale2);
                if (!bool2) {
                  if (this.S.get(locale2) == null)
                  {
                    localbb3 = new bb(locale1);
                    this.S.a(locale2, localbb3);
                    if (bool2) {
                      continue;
                    }
                    if (!bool1) {
                      break label515;
                    }
                  }
                }
                bb localbb3 = (bb)this.S.get(locale2);
                localbb3.add(locale1);
              }
              localw.f();
            }
          } while (!bool1);
        }
        label534:
        localObject2 = a((a.c.e)localObject1, paramo);
        if (!bool2)
        {
          if ((i != 0) && (!localbb1.isEmpty()) && (paramo.c(r.o) != null)) {
            a(localbb1);
          }
          a((a.c.e)localObject1);
          a(paramo, (List)localObject2);
        }
      }
      finally
      {
        a(localab);
        new a.f.hb().doLayout(paramo);
      }
    }
    finally
    {
      if (!bool2)
      {
        if (i != 0)
        {
          localy.g();
          a.f.c.e locale = new a.f.c.e();
          locale.c(false);
          locale.doLayout(paramo);
          paramo.a(this.S);
          paramo.a(this.T);
          this.U.e();
          this.U = null;
        }
        this.G.e();
        this.G = null;
        this.F.e();
        this.F = null;
        this.I.e();
        this.I = null;
        this.J.e();
        this.J = null;
        this.H.e();
        this.H = null;
      }
      if (!bool2)
      {
        if (this.V != null)
        {
          paramo.j(z);
          paramo.a(this.V);
          this.V = null;
        }
        this.K.a(this.B);
        this.K.a(this.A);
        this.B = null;
        this.A = null;
      }
      this.K = null;
    }
  }
  
  private void a(bb parambb)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    a.c.k localk1 = this.K.c(r.o);
    a.c.k localk2 = this.K.c(a.f.c.i.d);
    if ((bool2) || ((localk1 != null) && (localk2 != null)))
    {
      a.c.x localx1 = db.a(new double[this.K.k()]);
      a.c.x localx2 = db.a(new double[this.K.k()]);
      a.c.w localw1 = parambb.l();
      a.c.e locale1;
      Object localObject;
      label413:
      label420:
      label494:
      label496:
      label499:
      do
      {
        do
        {
          do
          {
            if (!localw1.e()) {
              break label499;
            }
            locale1 = localw1.d();
            localObject = a.d.u.a(localk2.get(locale1));
            if (bool1) {
              break label540;
            }
            if (localObject != null)
            {
              int i = 2147483647;
              int j = -2147483648;
              bb localbb1 = new bb();
              bb localbb2 = new bb();
              bb localbb3 = a(locale1, this.U);
              a.c.w localw2 = localbb3.l();
              a.c.e locale2;
              do
              {
                do
                {
                  if (!localw2.e()) {
                    break;
                  }
                  locale2 = localw2.d();
                  r.c_ localc_ = (r.c_)localk1.get(locale2);
                  if (bool1) {
                    break label543;
                  }
                  if (localc_ != null)
                  {
                    if (!bool2)
                    {
                      if (localc_.d() >= j)
                      {
                        if (!bool2) {
                          if (localc_.d() > j)
                          {
                            j = localc_.d();
                            localbb2.clear();
                          }
                        }
                        localbb2.add(locale2);
                      }
                      if (bool2) {
                        continue;
                      }
                    }
                    if (localc_.d() <= i)
                    {
                      if (!bool2) {
                        if (localc_.d() < i)
                        {
                          i = localc_.d();
                          localbb1.clear();
                        }
                      }
                      localbb1.add(locale2);
                    }
                  }
                  localw2.f();
                } while (!bool1);
              } while (bool2);
              localw2 = localbb1.l();
              double d;
              do
              {
                do
                {
                  if (!localw2.e()) {
                    break;
                  }
                  locale2 = localw2.d();
                  d = localx1.getDouble(locale2);
                  localx1.a(locale2, d + ((a.d.u)localObject).b);
                  localw2.f();
                  if (bool2) {
                    break label420;
                  }
                  if (bool1) {
                    break label413;
                  }
                } while (!bool1);
              } while (bool2);
              localw2 = localbb2.l();
              do
              {
                if (!localw2.e()) {
                  break;
                }
                locale2 = localw2.d();
                d = localx2.getDouble(locale2);
                localx2.a(locale2, d + ((a.d.u)localObject).d);
                localw2.f();
                if (bool2) {
                  break label496;
                }
                if (bool1) {
                  break label494;
                }
              } while (!bool1);
            }
          } while (bool2);
          localw1.f();
        } while (!bool1);
      } while (bool2);
      localw1 = this.K.v();
      label540:
      label543:
      do
      {
        if (!localw1.e()) {
          break;
        }
        locale1 = localw1.d();
        localObject = (r.c_)localk1.get(locale1);
        if (!bool2)
        {
          if (localObject != null)
          {
            gb localgb = h(locale1);
            if (!bool2) {
              if ((localgb instanceof u)) {
                localgb = ((u)localgb).a();
              }
            }
            if (bool2) {
              continue;
            }
            if ((localgb instanceof r)) {
              ((r.c_)localObject).a(locale1, this, ((r)localgb).b(), localx1.getDouble(locale1), localx2.getDouble(locale1));
            }
          }
          localw1.f();
        }
      } while (!bool1);
    }
  }
  
  private a.c.x a(q paramq, a.c.e parame)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    a.c.x localx = db.a(new int[paramq.k()]);
    bb[] arrayOfbb = b.a(paramq, new bb(parame));
    int i = 0;
    do
    {
      if (i >= arrayOfbb.length) {
        break;
      }
      a.c.w localw = arrayOfbb[i].l();
      if (localw.e())
      {
        localx.a(localw.d(), i);
        localw.f();
      }
      for (;;)
      {
        if (!bool2) {
          if (!bool1)
          {
            if (!bool1) {
              break;
            }
            if (bool2) {
              continue;
            }
            i++;
          }
        }
      }
    } while (!bool1);
    return localx;
  }
  
  private static a.c.e a(a.c.e parame1, a.c.e parame2, a.c.x paramx)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (!bool2) {
      if (parame1 == parame2) {
        return parame1;
      }
    }
    a.c.e locale1 = parame1;
    a.c.e locale2 = parame2;
    if (paramx.getInt(locale1) < paramx.getInt(locale2)) {}
    while (bool2)
    {
      if (bool2) {
        break label122;
      }
      locale2 = locale2.i().e();
      if (bool1) {
        break label116;
      }
      if (!bool1) {
        break;
      }
    }
    if (paramx.getInt(locale1) > paramx.getInt(locale2)) {
      locale1 = locale1.i().e();
    }
    label116:
    while (bool2)
    {
      if ((!bool2) && (bool1)) {
        break label160;
      }
      if (!bool1) {
        break;
      }
    }
    label122:
    if (locale1 != locale2) {
      locale1 = locale1.i().e();
    }
    label160:
    while (bool2)
    {
      if (!bool2)
      {
        if (bool1) {
          break label166;
        }
        locale2 = locale2.i().e();
      }
      if (!bool1) {
        break;
      }
    }
    label166:
    return locale1;
  }
  
  private static a.c.e a(a.c.e parame, bb parambb, a.c.x paramx)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    a.c.e locale1 = parambb.m();
    a.c.w localw = parambb.l();
    do
    {
      if (!localw.e()) {
        break;
      }
      a.c.e locale2 = localw.d();
      if (!bool2)
      {
        locale1 = a(locale1, locale2, paramx);
        if (bool1) {
          break label78;
        }
      }
      if (locale1 == parame) {
        return parame;
      }
      localw.f();
    } while (!bool1);
    label78:
    return locale1;
  }
  
  private bb a(a.c.e parame, h paramh)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    bb localbb1 = paramh.d(parame);
    bb localbb2 = new bb();
    a.c.w localw = localbb1.l();
    do
    {
      if (!localw.e()) {
        break;
      }
      a.c.e locale = localw.d();
      if (!bool2)
      {
        if (!paramh.e(locale)) {
          localbb2.add(locale);
        }
        localw.f();
      }
    } while (!bool1);
    return localbb2;
  }
  
  private void a(a.c.e parame)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    a.c.e[] arrayOfe = j(parame);
    int i = arrayOfe.length - 1;
    a.c.e locale1;
    Object localObject1;
    do
    {
      if (i < 0) {
        break;
      }
      locale1 = arrayOfe[i];
      if (bool1) {
        break label94;
      }
      if (locale1.e() > 0)
      {
        localObject1 = g(locale1);
        if (localObject1 != null) {
          locale1.b((Comparator)localObject1);
        }
        h(locale1).a(locale1, this.B);
      }
      i--;
    } while (!bool1);
    if (!bool2) {
      label94:
      i = 0;
    }
    do
    {
      do
      {
        if (i >= arrayOfe.length) {
          break;
        }
        locale1 = arrayOfe[i];
        b(locale1);
        localObject1 = e(locale1);
        this.A.a(locale1, localObject1);
        c(locale1);
        i++;
        if (bool2) {
          break label168;
        }
        if (bool1) {
          break label167;
        }
      } while (!bool1);
    } while (bool2);
    i = arrayOfe.length - 1;
    label167:
    label168:
    do
    {
      if (i < 0) {
        break;
      }
      double d1 = 0.0D;
      double d2 = 0.0D;
      a.c.e locale2 = arrayOfe[i];
      if ((bool2) || (locale2 != parame))
      {
        localObject2 = locale2.i().e();
        a_ locala_ = d((a.c.e)localObject2);
        d1 = locala_.l;
        d2 = locala_.m;
      }
      Object localObject2 = d(locale2);
      localObject2.l += d1;
      localObject2.m += d2;
      a(locale2, d1, d2);
      i--;
    } while (!bool1);
  }
  
  private List a(a.c.e parame, a.f.o paramo)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    z localz1 = new z();
    z localz2 = new z();
    do
    {
      localz2.add(parame);
      while (locald == null)
      {
        if (localz2.isEmpty()) {
          break;
        }
        a.c.e locale = (a.c.e)localz2.e();
        ib localib = h(locale).a(this, paramo, locale);
        if ((bool2) || (localib != null))
        {
          localib.a(this.F.a(), this.G.a(), this.H.a());
          localz1.a(localib);
        }
        locald = locale.h();
      }
      if ((bool2) || (bool1)) {
        break label170;
      }
      localz2.add(locald.f());
      a.c.d locald = locald.i();
    } while ((!bool2) && ((!bool1) && (!bool1)));
    label170:
    return localz1;
  }
  
  private void a(a.f.o paramo, List paramList)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    e(paramo);
    Iterator localIterator = paramList.iterator();
    do
    {
      do
      {
        ib localib;
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          localib = (ib)localIterator.next();
        } while (localib == null);
        localib.a();
      } while (bool2);
    } while (!bool1);
  }
  
  private void e(a.f.o paramo)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (!this.Q) {
      return;
    }
    a.c.k localk = paramo.c(oc.a);
    if (localk == null) {
      return;
    }
    m localm = paramo.w();
    label181:
    label183:
    do
    {
      do
      {
        if (!localm.e()) {
          return;
        }
        a.c.d locald = localm.a();
        zc localzc = paramo.d(locald.f());
        kc[] arrayOfkc = (kc[])localk.get(locald);
        if (arrayOfkc != null)
        {
          int i = 0;
          do
          {
            if (i >= arrayOfkc.length) {
              break;
            }
            kc localkc = arrayOfkc[i];
            double d1 = localkc.d();
            double d2 = localkc.e();
            localkc.b(d1 + localzc.a(), d2 + localzc.b());
            this.W.a(paramo, localkc);
            i++;
            if (bool2) {
              break label183;
            }
            if (bool1) {
              break label181;
            }
          } while (!bool1);
        }
      } while (bool2);
      localm.f();
    } while (!bool1);
  }
  
  private void b(a.c.e parame)
  {
    boolean bool = k.m;
    a.c.d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      a.c.e locale = locald.f();
      a_ locala_ = d(locale);
      locala_.l = locala_.k();
      locala_.m = locala_.l();
      locald = locald.i();
    } while (!bool);
  }
  
  private void c(a.c.e parame)
  {
    boolean bool = k.m;
    a.c.d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      a.c.e locale = locald.f();
      a_ locala_ = d(locale);
      locala_.l = (locala_.k() - locala_.l);
      locala_.m = (locala_.l() - locala_.m);
      locald = locald.i();
    } while (!bool);
  }
  
  protected a_ d(a.c.e parame)
  {
    return (a_)this.A.get(parame);
  }
  
  private void a(a.c.e parame, double paramDouble1, double paramDouble2)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    a_ locala_ = d(parame);
    locala_.b(paramDouble1, paramDouble2);
    a.c.d locald = parame.h();
    label134:
    label136:
    do
    {
      do
      {
        if (locald == null) {
          return;
        }
        zb localzb = this.K.e(locald);
        int i = 0;
        do
        {
          if (i >= localzb.a()) {
            break;
          }
          a.d.w localw = localzb.a(i);
          localzb.a(i, localw.a + locala_.l, localw.b + locala_.m);
          i++;
          if (bool2) {
            break label136;
          }
          if (bool1) {
            break label134;
          }
        } while (!bool1);
      } while (bool2);
      locald = locald.i();
    } while (!bool1);
  }
  
  protected a_ e(a.c.e parame)
  {
    hb localhb = f(parame);
    gb localgb = h(parame);
    localhb.a(this.K, parame);
    a_ locala_ = localgb.a(this.D, this.E, this.K, parame, (byte)this.B.getInt(parame));
    if (C())
    {
      w localw = new w(parame, this.K);
      localw.a(locala_, (byte)this.B.getInt(parame), this.C, a());
    }
    return locala_;
  }
  
  protected hb f(a.c.e parame)
  {
    boolean bool = k.n;
    if (!bool) {
      if (this.G != null)
      {
        hb localhb = (hb)this.G.get(parame);
        if (bool) {
          break label41;
        }
        if (localhb != null) {
          return localhb;
        }
      }
    }
    label41:
    return this.N;
  }
  
  protected Comparator g(a.c.e parame)
  {
    boolean bool = k.n;
    if (!bool) {
      if (this.H != null)
      {
        Comparator localComparator = (Comparator)this.H.get(parame);
        if (bool) {
          break label41;
        }
        if (localComparator != null) {
          return localComparator;
        }
      }
    }
    label41:
    return this.O;
  }
  
  protected gb h(a.c.e parame)
  {
    boolean bool = k.n;
    gb localgb = null;
    if ((bool) || (this.F != null)) {
      localgb = (gb)this.F.get(parame);
    }
    if ((bool) || (localgb != null)) {
      return a(parame, localgb);
    }
    if (parame.e() > 0) {
      return a(parame, this.L);
    }
    return a(parame, this.M);
  }
  
  private gb a(a.c.e parame, gb paramgb)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (((bool2) || (this.U != null)) && ((bool2) || ((this.S != null) && ((bool2) || (this.S.get(parame) != null)))))
    {
      a.c.k localk = this.K.c(a.f.c.i.d);
      bb localbb1 = (bb)this.S.get(parame);
      u localu = null;
      a.c.w localw = localbb1.l();
      label217:
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (!bool2) {}
        Object localObject = localk == null ? null : localk.get(locale);
        a.d.u localu1 = a.d.u.a(localObject);
        bb localbb2 = this.U.d(locale);
        if (!bool2) {
          if (localu == null)
          {
            localu = new u(paramgb, locale, localbb2, this.A, this.T, localu1);
            if (bool2) {
              continue;
            }
            if (!bool1) {
              break label217;
            }
          }
        }
        localu = new u(localu, locale, localbb2, this.A, this.T, localu1);
        localw.f();
      } while (!bool1);
      return localu;
    }
    return paramgb;
  }
  
  protected a_ i(a.c.e parame)
  {
    zc localzc = this.K.d(parame);
    a_ locala_ = new a_(parame, localzc);
    if (this.P)
    {
      w localw = new w(parame, this.K);
      localw.a(locala_);
    }
    return locala_;
  }
  
  protected a.c.e[] j(a.c.e parame)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    ArrayList localArrayList = new ArrayList(this.K.j());
    int[] arrayOfInt = new int[this.K.j()];
    a.c.e[] arrayOfe = this.K.t();
    int i = 0;
    do
    {
      if (i >= arrayOfe.length) {
        break;
      }
      int j = arrayOfe[i].e();
      arrayOfInt[i] = j;
      if (bool1) {
        break label107;
      }
      if (j == 0) {
        localArrayList.add(arrayOfe[i]);
      }
      i++;
    } while (!bool1);
    if (!bool2) {
      label107:
      i = 0;
    }
    do
    {
      do
      {
        if (localArrayList.isEmpty()) {
          break;
        }
        a.c.e locale1 = (a.c.e)localArrayList.remove(localArrayList.size() - 1);
        if (bool1) {
          break label234;
        }
        if ((bool2) || (locale1 != parame))
        {
          a.c.e locale2 = locale1.i().e();
          if (bool2) {
            continue;
          }
          if (arrayOfInt[locale2.f()] -= 1 == 0) {
            localArrayList.add(locale2);
          }
        }
        arrayOfe[(i++)] = locale1;
      } while (!bool1);
    } while (bool2);
    if (i != this.K.j()) {
      throw new RuntimeException("Not all nodes found!");
    }
    label234:
    return arrayOfe;
  }
  
  protected ab t()
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    ab localab = kb.i(this.K);
    do
    {
      m localm = localab.l();
      while (!bool1)
      {
        if (!localm.e()) {
          break;
        }
        this.K.e(localm.a());
        localm.f();
      }
    } while (bool2);
    return localab;
  }
  
  protected a.c.i u()
  {
    return (a.c.j)this.I.d();
  }
  
  protected a.c.i v()
  {
    return (a.c.j)this.J.d();
  }
  
  protected void a(ab paramab)
  {
    boolean bool = k.m;
    v localv = paramab.f();
    do
    {
      if (localv == null) {
        break;
      }
      a.c.d locald = (a.c.d)localv.c();
      wc.a(this.K.b(locald));
      cd localcd1 = cd.d(this.K, locald);
      cd localcd2 = cd.e(this.K, locald);
      this.K.e(locald);
      u().a(locald, localcd2);
      v().a(locald, localcd1);
      localv = localv.a();
    } while (!bool);
  }
  
  public gb w()
  {
    return this.L;
  }
  
  public void a(gb paramgb)
  {
    this.L = paramgb;
  }
  
  public gb x()
  {
    return this.M;
  }
  
  public void b(gb paramgb)
  {
    this.M = paramgb;
  }
  
  public hb y()
  {
    return this.N;
  }
  
  public void a(hb paramhb)
  {
    this.N = paramhb;
  }
  
  public Comparator z()
  {
    return this.O;
  }
  
  public void a(Comparator paramComparator)
  {
    this.O = paramComparator;
  }
  
  public void i(boolean paramBoolean)
  {
    this.P = paramBoolean;
    A();
  }
  
  private void A()
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (!bool2)
    {
      if (!this.Q)
      {
        if (bool2) {
          break label123;
        }
        if (!this.P) {}
      }
      else
      {
        d(new pc());
      }
    }
    else
    {
      vc localvc = b();
      if (!bool2)
      {
        if ((localvc instanceof pc))
        {
          ((pc)localvc).g(this.Q);
          ((pc)localvc).d(this.Q);
          ((pc)localvc).f(this.P);
        }
      }
      else
      {
        if (bool2) {
          break label119;
        }
        if (!bool1) {
          break label109;
        }
      }
      throw new IllegalStateException("No LabelLayoutTranslator registered");
      label109:
      if (bool2) {
        break label124;
      }
      c(true);
      if (!bool1) {
        label119:
        return;
      }
    }
    label123:
    label124:
    c(false);
  }
  
  public boolean B()
  {
    return this.P;
  }
  
  public boolean C()
  {
    return this.Q;
  }
  
  public void j(boolean paramBoolean)
  {
    this.Q = paramBoolean;
    A();
  }
  
  public static final class a_
  {
    public static final byte a = 1;
    public static final byte b = 2;
    public static final byte c = 4;
    public static final byte d = 8;
    public static final int e = 0;
    public static final int f = 1;
    public static final int g = 2;
    public static final int h = 3;
    private static final double i = 0.0001D;
    private f[] j = new f[4];
    double l;
    double m;
    private double n;
    private double o;
    private List p;
    private double q;
    private double r;
    private byte s;
    private a.c.e t;
    private zc u;
    public static boolean v;
    
    a_(a.c.e parame, zc paramzc)
    {
      this.t = parame;
      this.u = paramzc;
      this.n = paramzc.a();
      this.o = paramzc.b();
      double d1 = paramzc.c();
      if (!bool2) {
        if (d1 <= 0.0D)
        {
          d1 = 1.0D;
          this.n -= 0.5D;
        }
      }
      double d2 = paramzc.d();
      if (!bool2)
      {
        if (d2 <= 0.0D)
        {
          d2 = 1.0D;
          this.o -= 0.5D;
        }
        this.j[0] = new f(0.0D, d1, 0.0D);
        this.j[0].b(this.n);
        this.j[0].a(this.o);
        this.j[2] = new f(0.0D, d1, 0.0D);
        this.j[2].b(this.n);
        this.j[2].a(this.o + d2);
        this.j[1] = new f(0.0D, d2, 0.0D);
        this.j[1].b(this.o);
        this.j[1].a(this.n + d1);
        this.j[3] = new f(0.0D, d2, 0.0D);
        this.j[3].b(this.o);
        this.j[3].a(this.n);
        if (bool2) {}
      }
      else
      {
        if (parame.d() > 0)
        {
          a.f.o localo = (a.f.o)parame.g();
          a.d.w localw = localo.q(parame.i());
          this.q = (localw.a + d1 * 0.5D);
          this.r = (localw.b + d2 * 0.5D);
          if (bool2) {
            break label401;
          }
          if (!bool1) {
            break label396;
          }
          if (!bool2) {}
          q.n = !q.n;
        }
        this.q = 0.0D;
      }
      this.r = 0.0D;
      label396:
      this.s = 1;
      label401:
      if (bool2) {
        q.o = !q.o;
      }
    }
    
    public Rectangle2D.Double a()
    {
      return new Rectangle2D.Double(this.u.a(), this.u.b(), this.u.c(), this.u.d());
    }
    
    public Rectangle2D b()
    {
      double d1 = g();
      double d2 = h();
      return new Rectangle2D.Double(d1, d2, i() - d1, j() - d2);
    }
    
    public double c()
    {
      if (!k.n) {
        if (this.p == null) {
          return this.q + this.n;
        }
      }
      return ((a.d.w)this.p.get(this.p.size() - 1)).a + this.n;
    }
    
    public double d()
    {
      if (!k.n) {
        if (this.p == null) {
          return this.r + this.o;
        }
      }
      return ((a.d.w)this.p.get(this.p.size() - 1)).b + this.o;
    }
    
    public void e()
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      if ((bool2) || (this.p != null))
      {
        double d1 = this.q + this.n;
        double d2 = this.r + this.o;
        int k = 0;
        do
        {
          if (k >= this.p.size()) {
            break;
          }
          a.d.w localw = (a.d.w)this.p.get(k);
          a(d1, d2, localw.a + this.n, localw.b + this.o);
          d1 = localw.a + this.n;
          d2 = localw.b + this.o;
          k++;
        } while (!bool1);
      }
    }
    
    public void a(double paramDouble1, double paramDouble2)
    {
      if (!k.n) {
        if (this.p == null) {
          this.p = new ArrayList(8);
        }
      }
      this.p.add(new a.d.w(paramDouble1 - this.n, paramDouble2 - this.o));
    }
    
    public void a(a.f.o paramo, a.c.d paramd)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      zb localzb = paramo.e(paramd);
      a.d.w localw1 = paramo.r(paramd);
      double d1 = localw1.a;
      double d2 = localw1.b;
      int k = 0;
      do
      {
        if (k >= localzb.a()) {
          break;
        }
        a.d.w localw3 = localzb.a(k);
        a(d1, d2, localw3.a, localw3.b);
        d1 = localw3.a;
        if (!bool2)
        {
          if (bool1) {
            break label116;
          }
          d2 = localw3.b;
          k++;
        }
      } while (!bool1);
      label116:
      a.d.w localw2 = paramo.s(paramd);
      a(d1, d2, localw2.a, localw2.b);
    }
    
    public void a(zb paramzb)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      if ((bool2) || (this.p != null))
      {
        int k = this.p.size() - 1;
        do
        {
          if (k < 0) {
            break;
          }
          a.d.w localw = (a.d.w)this.p.get(k);
          paramzb.a(localw.a + this.n, localw.b + this.o);
          k--;
        } while (!bool1);
      }
    }
    
    public byte f()
    {
      return this.s;
    }
    
    public void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      if (!bool2) {}
      double d1 = paramDouble1 < paramDouble3 ? paramDouble1 : paramDouble3;
      if (!bool2) {}
      double d2 = paramDouble1 < paramDouble3 ? paramDouble3 : paramDouble1;
      if (!bool2) {}
      double d3 = paramDouble1 < paramDouble3 ? paramDouble2 : paramDouble4;
      if (!bool2) {}
      double d4 = paramDouble1 < paramDouble3 ? paramDouble4 : paramDouble2;
      if (!bool2) {}
      double d5 = paramDouble2 < paramDouble4 ? paramDouble2 : paramDouble4;
      if (!bool2) {}
      double d6 = paramDouble2 < paramDouble4 ? paramDouble4 : paramDouble2;
      if (!bool2) {}
      double d7 = paramDouble2 < paramDouble4 ? paramDouble1 : paramDouble3;
      if (!bool2) {}
      double d8 = paramDouble2 < paramDouble4 ? paramDouble3 : paramDouble1;
      if (!bool2) {
        if (Math.abs(paramDouble1 - paramDouble3) > 1.0D)
        {
          if (!bool2)
          {
            if (Math.abs(paramDouble2 - paramDouble4) > 1.0D)
            {
              this.j[0].e(new f(d1, d2, d3, d4));
              this.j[1].d(new f(d5, d6, d7, d8));
              this.j[2].d(new f(d1, d2, d3, d4));
              this.j[3].e(new f(d5, d6, d7, d8));
              if (bool2) {
                break label594;
              }
              if (!bool1) {
                break label591;
              }
            }
            this.j[0].a(d1, d2, d5);
            this.j[1].b(d5 - 0.5D, d6 + 0.5D, d2);
            this.j[2].b(d1, d2, d6);
            this.j[3].a(d5 - 0.5D, d6 + 0.5D, d1);
          }
          if (bool2) {
            break label594;
          }
          if (!bool1) {
            break label591;
          }
        }
      }
      if (!bool2)
      {
        if (Math.abs(paramDouble2 - paramDouble4) > 1.0D)
        {
          this.j[0].a(d1 - 0.5D, d2 + 0.5D, d5);
          this.j[1].b(d5, d6, d2);
          this.j[2].b(d1 - 0.5D, d2 + 0.5D, d6);
          this.j[3].a(d5, d6, d1);
        }
      }
      else
      {
        if (bool2) {
          break label594;
        }
        if (!bool1) {
          break label591;
        }
      }
      this.j[0].a(d1 - 0.5D, d2 + 0.5D, d5);
      this.j[1].b(d5 - 0.5D, d6 + 0.5D, d2);
      this.j[2].b(d1 - 0.5D, d2 + 0.5D, d6);
      this.j[3].a(d5 - 0.5D, d6 + 0.5D, d1);
      label591:
      label594:
      if ((bool2) || (q.n))
      {
        if (!bool2) {}
        k.m = !bool1;
      }
      if (q.o) {
        k.n = !bool2;
      }
    }
    
    public void b(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      f localf1 = a(0);
      f localf2 = a(1);
      f localf3 = a(2);
      f localf4 = a(3);
      if (!k.n) {
        if (paramDouble3 > 0.0D)
        {
          localf1.a(paramDouble1, paramDouble1 + paramDouble3, paramDouble2);
          localf3.b(paramDouble1, paramDouble1 + paramDouble3, paramDouble2 + paramDouble4);
        }
      }
      if (paramDouble4 > 0.0D)
      {
        localf2.b(paramDouble2, paramDouble2 + paramDouble4, paramDouble1 + paramDouble3);
        localf4.a(paramDouble2, paramDouble2 + paramDouble4, paramDouble1);
      }
    }
    
    void a(a.d.o paramo)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      if (!bool2) {
        if (b(paramo))
        {
          if (bool2) {
            break label58;
          }
          localObject1 = paramo.a();
          b(((t)localObject1).d(), ((t)localObject1).e(), ((t)localObject1).b(), ((t)localObject1).c());
          if (!bool1) {
            return;
          }
        }
      }
      label58:
      Object localObject1 = a.d.o.a(paramo);
      int k = 0;
      do
      {
        if (k >= localObject1.length) {
          break;
        }
        Object localObject2 = localObject1[k];
        Object localObject3 = localObject1[((k + 1) % localObject1.length)];
        a(localObject2.a, localObject2.b, localObject3.a, localObject3.b);
        k++;
      } while (!bool1);
    }
    
    private static boolean b(a.d.o paramo)
    {
      boolean bool = k.n;
      if (!bool) {
        if (Math.abs(paramo.i()) >= 0.0001D) {
          if (bool) {
            break label41;
          }
        }
      }
      label41:
      return Math.abs(paramo.j()) < 0.0001D;
    }
    
    public void a(a_ parama_)
    {
      this.j[0].e(parama_.j[0]);
      this.j[1].d(parama_.j[1]);
      this.j[2].d(parama_.j[2]);
      this.j[3].e(parama_.j[3]);
    }
    
    public double g()
    {
      return Math.min(this.j[0].a(), Math.min(this.j[2].a(), this.j[3].c()));
    }
    
    public double h()
    {
      return Math.min(this.j[0].c(), Math.min(this.j[1].a(), this.j[3].a()));
    }
    
    public double i()
    {
      return Math.max(this.j[0].b(), Math.max(this.j[2].b(), this.j[1].d()));
    }
    
    public double j()
    {
      return Math.max(this.j[1].b(), Math.max(this.j[2].d(), this.j[3].b()));
    }
    
    public f a(int paramInt)
    {
      if (((!k.n) && (paramInt < 0)) || (paramInt > 3)) {
        throw new IllegalArgumentException("Unknown border line index" + paramInt);
      }
      return this.j[paramInt];
    }
    
    public void b(double paramDouble1, double paramDouble2)
    {
      this.j[0].b(paramDouble1);
      this.j[0].a(paramDouble2);
      this.j[1].b(paramDouble2);
      this.j[1].a(paramDouble1);
      this.j[2].b(paramDouble1);
      this.j[2].a(paramDouble2);
      this.j[3].b(paramDouble2);
      this.j[3].a(paramDouble1);
      this.n += paramDouble1;
      this.o += paramDouble2;
      this.u.a(this.u.a() + paramDouble1, this.u.b() + paramDouble2);
    }
    
    public double k()
    {
      return this.n;
    }
    
    public double l()
    {
      return this.o;
    }
    
    public a_ a(k.b_ paramb_)
    {
      a_ locala_ = new a_(this.t, new a.f.sb());
      locala_.s = this.s;
      a(locala_, paramb_);
      return locala_;
    }
    
    public void a(a_ parama_, k.b_ paramb_)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      k.a_ locala_1 = k.a_.a(this.u.c(), this.u.d());
      k.a_ locala_2 = locala_1.a(paramb_);
      parama_.u.b(locala_2.a(0), locala_2.a(1));
      k.a_ locala_3 = k.a_.a(this.n, this.o);
      k.a_ locala_4 = locala_3.a(paramb_);
      parama_.n = locala_4.a(0);
      parama_.o = locala_4.a(1);
      parama_.u.a(locala_4.a(0), locala_4.a(1));
      k.a_ locala_5 = k.a_.a(this.q, this.r);
      k.a_ locala_6 = locala_5.a(paramb_);
      parama_.q = locala_6.a(0);
      parama_.r = locala_6.a(1);
      f[] arrayOff = new f[4];
      int k = 0;
      if (k < this.j.length) {}
      Object localObject1;
      Object localObject2;
      Object localObject3;
      for (;;)
      {
        if (!bool2)
        {
          localObject1 = this.j[k];
          localObject2 = paramb_.a();
          if (!bool1)
          {
            k.a_ locala_7;
            k.a_ locala_9;
            if (((!bool2) && (k == 0)) || (k == 2))
            {
              locala_7 = ((k.b_)localObject2).c(0);
              locala_9 = ((k.b_)localObject2).c(1);
              if (!bool2) {}
              if (!bool2) {}
              localObject3 = ((f)localObject1).a(locala_9.a() < 0.0D, locala_7.a() < 0.0D);
              if (bool2) {
                break label371;
              }
              if (!bool1) {}
            }
            else
            {
              locala_7 = ((k.b_)localObject2).c(0);
              locala_9 = ((k.b_)localObject2).c(1);
              if (!bool2) {}
              if (!bool2) {}
              localObject3 = ((f)localObject1).a(locala_7.a() < 0.0D, locala_9.a() < 0.0D);
            }
            label371:
            int i1 = k.a_.b(k).a(paramb_).b();
            arrayOff[i1] = localObject3;
            k++;
            if (!bool1) {
              break;
            }
            if (bool2) {
              continue;
            }
            parama_.j = arrayOff;
          }
        }
      }
      if (this.p != null)
      {
        ArrayList localArrayList = new ArrayList();
        localObject1 = this.p.iterator();
        if (((Iterator)localObject1).hasNext()) {}
        while (bool2)
        {
          localObject2 = (a.d.w)((Iterator)localObject1).next();
          localObject3 = k.a_.a((a.d.w)localObject2);
          k.a_ locala_8 = ((k.a_)localObject3).a(paramb_);
          localArrayList.add(new a.d.w(locala_8.a(0), locala_8.a(1)));
          if ((!bool2) && (bool1)) {
            return;
          }
          if (!bool1) {
            break;
          }
        }
        parama_.p = localArrayList;
      }
    }
    
    a.c.e m()
    {
      return this.t;
    }
    
    zc n()
    {
      return this.u;
    }
    
    public String toString()
    {
      if (!k.n) {}
      return "SubtreeShape{x=" + this.n + ", y=" + this.o + ", dx=" + this.l + ", dy=" + this.m + ", borderLines=" + (this.j == null ? null : Arrays.asList(this.j)) + "}";
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.n.d

 * JD-Core Version:    0.7.0.1

 */